package com.lcy.springtest.bean;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.factory.annotation.Value;

/**
 * @author lichenyang
 * @create 2021-04-15 9:25 下午
 */
@Data
public class Person {

//    @Value("zhangsan")
    @Value("${name}")
    private String name;
    @Value("#{20-2}")
    private int age;


    public void init(){
        System.out.println("... init ...");
    }

    public void destroy(){
        System.out.println("... destroy ...");
    }
    public Person() {
        System.out.println("无参构造方法");
    }

    public Person(int age, String name) {
        System.out.println("有参构造方法");
        this.age = age;
        this.name = name;
    }
}
